package com.sam.mvp.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @ProjectName: SamLib
 * @Package: com.sam.mvp.entity
 * @ClassName: User
 * @Description:
 * @Author: Carl
 * @CreateDate: 2018/10/23 9:24
 * @UpdateUser:
 * @UpdateDate: 2018/10/23 9:24
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public class User implements Parcelable {
    public int id;
    public String name;
    public int age;
    public int sex;
    public String niceName;

    public String login;
    public String avatar_url;


    public User() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeString(this.name);
        dest.writeInt(this.age);
        dest.writeInt(this.sex);
        dest.writeString(this.niceName);
        dest.writeString(this.login);
        dest.writeString(this.avatar_url);
    }

    protected User(Parcel in) {
        this.id = in.readInt();
        this.name = in.readString();
        this.age = in.readInt();
        this.sex = in.readInt();
        this.niceName = in.readString();
        this.login = in.readString();
        this.avatar_url = in.readString();
    }

    public static final Creator<User> CREATOR = new Creator<User>() {
        @Override
        public User createFromParcel(Parcel source) {
            return new User(source);
        }

        @Override
        public User[] newArray(int size) {
            return new User[size];
        }
    };
}
